<?php
//file to shift predefined image from directory to another directory

//$src=$_POST['bgsrc'];


list($width, $height, $type, $attr) = getimagesize("imagesapp/back.png");
/*echo "Image width " .$width;
echo "<BR>";
echo "Image height " .$height;
echo "<BR>";
echo "Image type " .$type;
echo "<BR>";
echo "Attribute " .$attr;
*/
	//output:: Image width 992<BR>Image height 714<BR>Image type 2<BR>Attribute width="992" height="714"

//$aspectratio=$width/$height;

$aspectratio = $width / $height;
if ($aspectratio >= 1) {//width is greater than height
    if ($width > 580) {
        echo ("width100% ");

        $h = ceil(580 / $aspectratio);
        echo ($h);
    }
} else if ($aspectratio < 1) {
    if ($height > 350) {
        echo ("height100% ");
        $w = ceil(350 * $aspectratio);
        echo ($w);
    }
}


/*

rename("/tmp/tmp_file.txt", "/home/user/login/docs/my_file.txt");


	*/
	
	
	
	
	
?>
